home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 26 / Cream of the Crop 26.iso / os2 / timidsrc.zip / Makefile < prev    next >
Makefile  |  1997-05-25  |  10KB  |  355 lines

  1. #
  2. # TiMidity -- Experimental MIDI to WAVE converter
  3. # Copyright (C) 1995 Tuukka Toivonen <toivonen@clinet.fi>
  4. #
  5. # This program is free software; you can redistribute it and/or modify
  6. # it under the terms of the GNU General Public License as published by
  7. # the Free Software Foundation; either version 2 of the License, or
  8. # (at your option) any later version.
  9. #
  10. # This program is distributed in the hope that it will be useful,
  11. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13. # GNU General Public License for more details.
  14. #
  15. # You should have received a copy of the GNU General Public License
  16. # along with this program; if not, write to the Free Software
  17. # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  18. #
  19. # This Makefile is known to work with GNU make.
  20.  
  21. ########### Installation options
  22. #
  23. # This looks like a job for Autoconf Repairman!
  24. # But where to change without revealing my secret identity?
  25.  
  26. ########### Compiler and flags.
  27. CC = gcc
  28. DEBUGFLAGS = -O2
  29.  
  30. ########### Install.
  31. INSTALL = /usr/bin/install
  32.  
  33. # Where to install the executable
  34. BIN_DIR = /usr/local/bin
  35.  
  36. # Where to install the manual pages
  37. MAN_DIR = /usr/local/man/man1
  38.  
  39. # Where to install the patches, config files, and MIDI files.
  40. # If you change this, it's a good idea to recompile the binary,
  41. # or you'll need to invoke timidity with the -L option.
  42. TIMID_DIR = /timidity
  43.  
  44. # Where to install the Tcl code, if you use the Tcl code that is.
  45. TCL_DIR = $(TIMID_DIR)
  46.  
  47. ########### Compilation options -- there are more in config.h.
  48. #
  49. # Uncomment the lines you need, changing library paths as required.
  50.  
  51. ########### Audio device selection
  52. #
  53. # Select one only. If your make doesn't understand +=, you may have to
  54. # do some axe work.
  55.  
  56. # Select the Linux/FreeBSD audio driver
  57. #SYSTEM += -DAU_LINUX
  58. #SYSEXTRAS += linux_a.c
  59. #EXTRAINCS +=
  60. #EXTRALIBS +=
  61.  
  62. ## Select the HP-UX network audio server
  63. #SYSTEM += -DHPUX -DAU_HPUX
  64. #SYSEXTRAS += hpux_a.c
  65. ##EXTRAINCS +=
  66. #EXTRALIBS += -lAlib
  67.  
  68. ## Select the Sun audio driver (for SunOS)
  69. #SYSTEM += -DSUN -D__USE_GNU -DAU_SUN
  70. #SYSEXTRAS += sun_a.c
  71. #EXTRAINCS += -I/usr/demo/SOUND
  72. #EXTRALIBS += -L/usr/demo/SOUND -laudio
  73.  
  74. ## Select the Sun audio driver (for Solaris)
  75. #SYSTEM += -DSUN -DSOLARIS -DAU_SUN
  76. #SYSEXTRAS += sun_a.c
  77. #EXTRAINCS += -I/usr/demo/SOUND/include
  78. #EXTRALIBS += -L/usr/demo/SOUND/lib -laudio -lsocket
  79.  
  80. ## Select the DEC MMS audio server
  81. #SYSTEM += -DDEC -DAU_DEC
  82. #SYSEXTRAS += dec_a.c
  83. #EXTRAINCS += -I/usr/include/mme
  84. #EXTRALIBS += -lmme
  85.  
  86. ## Select the OS/2 Dart audio server
  87. SYSTEM += -DAU_DART
  88. SYSEXTRAS += dart_a.c
  89. EXTRALIBS += -l./mmpm2
  90. ## Needed for compiling for OS/2
  91. DEBUGFLAGS += -Zexe -s
  92.  
  93. ## Select the RTMMM audio server
  94. #SYSTEM += -DAU_RTMMM -D__USE_DART__
  95. #EXTRAOBJS += rtmmm_a.o 
  96. #EXTRALIBS += -lAudioStream -lmmpm2 -lstdcpp
  97. # DARTOutputAudioStream.o RTMMMOutputAudioStream.o
  98. #DEBUGFLAGS += -Zmtd -Wno-unused -D__ST_MT_ERRNO__ 
  99.  
  100. ########### User interface selection
  101. #
  102. # Select any combination by uncommenting and editing the appropriate
  103. # lines.  If you don't have ncurses, slang, motif, _or_ Tcl/Tk, you'll
  104. # have to make do with a non-interactive interface that just prints out
  105. # messages.
  106.  
  107. # Select the ncurses full-screen interface
  108. #SYSTEM += -DIA_NCURSES
  109. #SYSEXTRAS += ncurs_c.c
  110. #EXTRAINCS += -I/usr/include/ncurses
  111. #EXTRALIBS += -lncurses
  112.  
  113. ## Select the S-Lang full-screen interface
  114. SYSTEM += -DIA_SLANG
  115. SYSEXTRAS += slang_c.c
  116. #EXTRAINCS += -I/usr/include/slang
  117. EXTRALIBS += -lslang
  118. # Needed for OS/2 slang
  119. EXTRALIBS += -lvideo
  120. DEBUGFLAGS += -Zmtd -D__ST_MT_ERRNO__
  121.  
  122. ## Select the MOTIF interface
  123. #SYSTEM += -DMOTIF
  124. #SYSEXTRAS += motif_c.c motif_i.c motif_p.c
  125. #EXTRAINCS += -I/usr/local/X11R5/include -L/usr/local/X11R5/lib
  126. #EXTRAINCS += -I/usr/include/X11
  127. #EXTRALIBS += -lXm -lXt -lX11
  128. ## Solaris needs libgen?
  129. #EXTRALIBS += -lgen
  130.  
  131. # Select the Tcl/Tk interface
  132. #SYSTEM += -DTCLTK -DWISH=\"wishx\" -DTKPROGPATH=\"$(TCL_DIR)/tkmidity.tcl\"
  133. #SYSEXTRAS += tk_c.c
  134. #INST_TK = install.tk
  135. #EXTRAINCS +=
  136. #EXTRALIBS +=
  137.  
  138. ## Select the OS/2-PM interface
  139. #SYSTEM += -DPM
  140. #SYSEXTRAS += pm_c.c
  141. #EXTRAOBJS += muldiv.o timidity.res timidity.def
  142. #DEBUGFLAGS += -Zmtd -D__ST_MT_ERRNO__
  143.  
  144. ########### Now check out the options in config.h
  145.  
  146. #########################################################################
  147. # You shouldn't need to change anything beyond this line
  148.  
  149. .SUFFIXES: .c .h .ptcl .tcl .o .1 .txt .ps
  150.  
  151. VERSION = 0.2i
  152. FNVERSION = 02i
  153. SUPPVERSION = 0.2
  154. FNSUPPVERSION = 02
  155.  
  156. PROJ = timidity
  157. DIST = timidity-$(VERSION).tar.gz
  158. DISTZIP = timid$(FNVERSION).zip
  159. SDIST = timidity-lib-$(SUPPVERSION).tar.gz
  160. SDISTZIP = tilib$(FNSUPPVERSION).zip
  161.  
  162. CFLAGS= $(DEBUGFLAGS) -DDEFAULT_PATH=\"$(TIMID_DIR)\" \
  163.         -DTIMID_VERSION=\"$(VERSION)\" $(SYSTEM) $(EXTRAINCS)
  164.  
  165. ########### All relevant files.. Anybody know autoconf?
  166.  
  167. # Sources needed for every installation
  168. CSRCS = timidity.c common.c readmidi.c playmidi.c resample.c mix.c instrum.c \
  169.     tables.c controls.c output.c filter.c \
  170.     wave_a.c raw_a.c dumb_c.c
  171.  
  172. # Optional installation-specific sources
  173. OPTSRCS = hpux_a.c linux_a.c sun_a.c dec_a.c win_a.c \
  174.     ncurs_c.c slang_c.c tk_c.c \
  175.     motif_c.c motif_i.c motif_p.c
  176.  
  177. # External utility sources
  178. TOOLSRCS = bag.c wav2pat.c
  179.  
  180. # Tcl interface sources
  181. TCLSRCS = tkmidity.ptcl tkpanel.tcl browser.tcl misc.tcl
  182.  
  183. # Things used by MSDOS/Windows
  184. GETOPTSRCS = getopt.c timidity.ide timidity.mak
  185.  
  186. # Miscellaneous things to distribute in the source archive
  187. MAKEFILES = Makefile my my.pl
  188. BITMAPS = tkbitmaps/prev.xbm tkbitmaps/next.xbm tkbitmaps/play.xbm \
  189.     tkbitmaps/stop.xbm tkbitmaps/pause.xbm tkbitmaps/quit.xbm \
  190.     BITMAPS/back.xbm BITMAPS/fwd.xbm BITMAPS/next.xbm BITMAPS/pause.xbm \
  191.     BITMAPS/prev.xbm BITMAPS/quit.xbm BITMAPS/restart.xbm \
  192.     BITMAPS/timidity.xbm
  193.  
  194. # All headers
  195. CHDRS = config.h common.h readmidi.h playmidi.h resample.h mix.h instrum.h \
  196.     tables.h controls.h output.h filter.h motif.h
  197.  
  198. # Used in making the distribution archive
  199. ALLSRCS = $(CSRCS) $(OPTSRCS) $(CHDRS) $(TOOLSRCS) $(TCLSRCS) $(MAKEFILES) \
  200.     $(BITMAPS) $(GETOPTSRCS)
  201.  
  202. TCLF = tkmidity.tcl tkpanel.tcl browser.tcl misc.tcl
  203. ALLTCLF = $(TCLF) tclIndex
  204. BITMAPF = tkbitmaps/prev.xbm tkbitmaps/next.xbm tkbitmaps/play.xbm \
  205.         tkbitmaps/stop.xbm tkbitmaps/pause.xbm tkbitmaps/quit.xbm \
  206.         BITMAPS/timidity.xbm
  207.  
  208. MANPAGES = timidity.1
  209. TXTPAGES = $(MANPAGES:.1=.txt)
  210. PSPAGES = $(MANPAGES:.1=.ps)
  211. DOCS = README README.tk README.DEC README.W32 \
  212.         COPYING INSTALL CHANGES TODO FAQ $(MANPAGES) $(TXTPAGES) $(PSPAGES)
  213.  
  214. CONFIGF = timidity.cfg gsdrum.cfg gravis.cfg midia.cfg wowpats.cfg mt32.cfg
  215.  
  216. PATCHF = patch/acpiano.pat patch/nylongt2.pat
  217. SAMPLEF = midi/cavatina.mid midi/impromptu.mid midi/malaguena.mid \
  218.           midi/test-decay.mid midi/test-panning.mid midi/test-scale.mid
  219.  
  220. # These get stuffed in the distribution archive
  221. ALLDIST = $(DOCS) $(ALLSRCS) $(CONFIGF)
  222.  
  223. # These go in the support archive
  224. SUPPDIST = $(PATCHF) $(SAMPLEF) README.lib
  225.  
  226. ########### Rules
  227.  
  228. COBJS = $(CSRCS:.c=.o) $(SYSEXTRAS:.c=.o)
  229.  
  230. TOOLS = $(TOOLSRCS:.c=)
  231.  
  232. all: $(PROJ) $(TOOLS)
  233.  
  234. clean:
  235.     rm -f $(COBJS) core
  236.  
  237. spotless: clean
  238.     rm -f $(PROJ) $(TOOLS) $(TXTPAGES) $(PSPAGES) \
  239.         $(DIST) $(SDIST) $(DIST).CONTENTS $(SDIST).CONTENTS \
  240.         $(DISTZIP) $(SDISTZIP) $(DISTZIP).CONTENTS $(SDISTZIP).CONTENTS
  241.  
  242. .c.o:
  243.     $(CC) $(CFLAGS) -c $<
  244.  
  245. timidity.res: timidity.Rc
  246.     rc -r timidity.Rc
  247.  
  248. .cc.o:
  249.     $(CC) $(CFLAGS) -c $<
  250.  
  251. $(PROJ): $(COBJS) $(EXTRAOBJS)
  252.     $(CC) $(CFLAGS) -o $(PROJ) $(COBJS) $(EXTRAOBJS) $(EXTRALIBS) -lm
  253.  
  254. bag: bag.c
  255.     $(CC) $(CFLAGS) -o bag bag.c
  256.  
  257. wav2pat: wav2pat.c
  258.     $(CC) $(CFLAGS) -o wav2pat wav2pat.c
  259.  
  260. depends depend dep:
  261.     $(CC) $(CFLAGS) -MM $(CSRCS) $(OPTSRCS) $(TOOLSRCS) > depends
  262.  
  263. include depends
  264.  
  265. ########### Installation targets
  266.  
  267. install:
  268.     @echo
  269.     @echo Please enter one of the commands below:
  270.     @echo
  271.     @echo \"make install.bin\" - Install the executable in $(BIN_DIR).
  272.     @echo \"make install.man\" - Install the manual page in $(MAN_DIR).
  273.     @echo \"make install.lib\" - Install the library files in $(TIMID_DIR).
  274.     @echo \"make install.all\" - All of the above.
  275.     @echo
  276.  
  277. install.all: install.bin install.man install.lib
  278.  
  279. # install.bin: $(PROJ) Dumb make thinks it has to have $(COBJS) to install...
  280. install.bin:
  281.     mkdir -p $(BIN_DIR)
  282.     $(INSTALL) -s -m 755 $(PROJ) $(TOOLS) $(BIN_DIR)
  283.  
  284. install.man:
  285.     mkdir -p $(MAN_DIR)
  286.     $(INSTALL) -m 644 $(MANPAGES) $(MAN_DIR)
  287.  
  288. install.lib: install.config install.patch $(INST_TK)
  289.  
  290. install.config: $(CONFIGF)
  291.     mkdir -p $(TIMID_DIR)
  292.     $(INSTALL) -m 644 $(CONFIGF) $(TIMID_DIR)
  293.  
  294. install.patch: $(PATCHF)
  295.     mkdir -p $(TIMID_DIR)/patch
  296.     $(INSTALL) -m 644 $(PATCHF) $(TIMID_DIR)/patch
  297.  
  298. install.tk: $(ALLTCLF)
  299.     $(INSTALL) -m 644 $(ALLTCLF) $(TCL_DIR)
  300.     mkdir -p $(TCL_DIR)/BITMAPS
  301.     $(INSTALL) -m 644 $(BITMAPF) $(TCL_DIR)/BITMAPS
  302.  
  303. .ptcl.tcl:
  304.     sed -e s@%TCL_DIR%@$(TCL_DIR)@g $< > $@
  305.  
  306. .1.txt:
  307.     groff -man -Tlatin1 -P-b -P-u $< >$@
  308.  
  309. .1.ps:
  310.     groff -man $< >$@
  311.  
  312. tclIndex: $(TCLF)
  313.     echo 'auto_mkindex . *.tcl; exit' | wish
  314.  
  315. ########## Some special targets
  316.  
  317. time:
  318.     time ./$(PROJ) -idq -s32 -p32 -Or -o/dev/null \
  319.     -c /usr/local/lib/timidity/timidity.cfg \
  320.     $(HOME)/midi/jazz/jzdwing.mid.gz
  321.  
  322. dist: $(DIST) $(DISTZIP)
  323.  
  324. sdist: $(SDIST) $(SDISTZIP)
  325.  
  326. putup: $(DIST) $(DISTZIP)
  327.     changes2html < CHANGES > changes.html
  328.     faq2html < FAQ > faq.html
  329.     cp /home/titoivon/public_html/timidity/index.html index.html
  330.     tar czvf /home/titoivon/putup.tgz $(DIST) $(DIST).CONTENTS \
  331.         changes.html faq.html timidity.txt index.html \
  332.         INSTALL COPYING
  333.     rm changes.html faq.html timidity.txt index.html
  334.  
  335. $(DIST) $(DISTZIP): $(ALLDIST)
  336.     -rm -rf /tmp/timidity-$(VERSION) /tmp/timid$(FNVERSION)
  337.     mkdir /tmp/timidity-$(VERSION)
  338.     cp -aP $(ALLDIST) /tmp/timidity-$(VERSION)
  339.     (cd /tmp && tar czvf $(DIST) timidity-$(VERSION))
  340.     (cd /tmp && mv timidity-$(VERSION) timid$(FNVERSION) && \
  341.         zip -r $(DISTZIP) timid$(FNVERSION))
  342.     mv /tmp/$(DIST) /tmp/$(DISTZIP) .
  343.     rm -rf /tmp/timid$(FNVERSION)
  344.     tar tzvf $(DIST) >$(DIST).CONTENTS
  345.     unzip -lv $(DISTZIP) >$(DISTZIP).CONTENTS
  346.  
  347. $(SDIST): $(SUPPDIST)
  348.     tar czf $(SDIST) $(SUPPDIST)
  349.     tar tzvf $(SDIST) >$(SDIST).CONTENTS
  350.     zip $(SDISTZIP) $(SUPPDIST)
  351.     unzip -lv $(SDISTZIP) >$(SDISTZIP).CONTENTS
  352.  
  353.  
  354. ########## End of Makefile
  355.